package com.clayecloud.module_main.viewModels;

import android.graphics.Color;

import androidx.lifecycle.MutableLiveData;
import androidx.lifecycle.ViewModel;

import com.clayecloud.module_main.entity.LifeCard;
import java.util.ArrayList;
import java.util.List;

public class FragmentLifeViewModel extends ViewModel {

    private MutableLiveData<List<LifeCard>> lifeCards;

    public MutableLiveData<List<LifeCard>> getLifeCards() {
        return lifeCards;
    }

    public void setLifeCards(MutableLiveData<List<LifeCard>> lifeCards) {
        this.lifeCards = lifeCards;
    }

    /**
     * 处理此模块的数据
     * @return boolean 数据是否处理成功
     */
    public boolean loadData() {
        List<LifeCard> lifeCards = new ArrayList<>();
        lifeCards.add(new LifeCard("丰巢取件","用于丰巢快递柜", Color.parseColor("#FAF2E5")));   //#FAF2E5
        lifeCards.add(new LifeCard("货运搬家","呼叫搬运用车", Color.parseColor("#E4ECF9")));     //E4ECF9
        lifeCards.add(new LifeCard("国家电网","用于国网通用充电桩", Color.parseColor("#FFD6C8")));     //FFD6C8
        MutableLiveData<List<LifeCard>> listMutableLiveData = new MutableLiveData<>();
        listMutableLiveData.setValue(lifeCards);
        this.lifeCards = listMutableLiveData;
        return true;
    }
}
